-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Argument for Filtering Token Types #34
base: main
Are you sure you want to change the base?
Conversation
It's a bit too specific imo. Adding a filter options to filter an array of token types would be a better solution. You have removed a lot of comments, I don't think it was necessary. Please add unit tests. Please update documentation. |
Thank you for the quick comments. I made the recommended code changes. Let me know if that looks good and I'll update with tests and docs later |
Looks good to me :) |
Should this be This filtering does what? It filters out all the tokens that were part of a token set while letting them be used as a base value for tokens that are retained? |
Yes, that is the intended usage. Technically there isn't enforcement regarding whether the filtered out items were used as a base value for other tokens, so it could be used to omit sets for other reasons if those exist. Happy to rename to |
I renamed the argument and added tests |
Addresses #32
Pull Request: Add Argument for Filtering Token Types
Overview
This pull request introduces a new argument,
filteredTokenTypes
, to exclude specified token types from parsed results:filteredTokenTypes
--filtered-token-types=core,source
Files Modified
bin/figma2flutter.dart
filteredTokenTypes
optionfilteredTypes
to_processTokens
_processTokens
lib/config/options.dart
filteredTokenTypes
constants and option for configurationlib/processor.dart
process
method to acceptfilteredTypes
filteredTypes
listExample Usage
To run the tool and exclude tokens of types
core
andsource
:This will filter out tokens with paths starting with
core
orsource
.Conclusion
These updates provide more control over the token processing, enabling users to fine-tune their output. Please review the changes and provide your feedback.
Notes:
I tried skipping reading the "Core" tokens altogether, but other tokens rely on their processing to assign the correct values.